import java.util.ArrayList;

public class HR extends Employee{

	private ArrayList<Employee> employees;

	public ArrayList<Employee> getEmployees() {
		return employees;
	}
	
	public void setEmployees(ArrayList<Employee> employees) {
		this.employees = employees;
	}

	public HR(String name, String number, int salary ) {
		super(name, number, salary);
	}
	
	public HR(ArrayList<Employee> employees) {
		this.employees = employees;
	}
	public Employee getTopSalaryEmployee(ArrayList<Employee> employees){
		Employee e=new Employee();
		e.setSalary(0);
		for(int i=0;i<20;i++){
		if(employees.get(i).getSalary()>e.getSalary()){
			e=employees.get(i);
		}
		}
		return e;
	}
	public ArrayList<Employee>  getTop10SalaryEmployee(ArrayList<Employee> employees){
		ArrayList<Employee> e=new ArrayList<Employee> ();
		ArrayList<Employee> e1=new ArrayList<Employee> ();
		for(int i=0;i<20;i++){
			e1.add(employees.get(i));
		}
		Employee em;
		for(int i=0;i<20;i++){
			int k=i;
			for(int j=i;j<20;j++){
				if(e1.get(k).getSalary()<e1.get(j).getSalary()){
					k=j;
				}
			}
			em=e1.get(k);
			e1.set(k, e1.get(i));
			e1.set(i, em);
		}
		for(int i=0;i<10;i++){
			e.add(e1.get(i));
		}
		return e;
		
	}
	public void enrollEmployee(ArrayList<Employee> employees,Employee e){
		employees.add(e);
	}
	public void resignEmployee(ArrayList<Employee> employees,String number){
		for(int i=0;i<employees.size();i++){
			if(employees.get(i).getNumber().equals(number)){
				employees.remove(i);
			}
		}
	}
	
	


}
